<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>登录 | PDMRead</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/static/bootstrap5/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background: url('/static/images/bg-dark.jpg') no-repeat center center fixed;
            background-size: cover;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 10%;
            color: #fff;
        }

        .glass-card {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 1rem;
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #fff;
        }

        .form-control {
            background-color: rgba(255, 255, 255, 0.1);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .form-control:focus {
            background-color: rgba(255, 255, 255, 0.2);
            color: #fff;
        }

        label {
            color: #ccc;
        }

        .btn-primary {
            background-color: rgba(22, 186, 107, 0.93);
            border: none;
        }

        .alert {
            color: #fff;
        }
    </style>
</head>
<body>

<div class="col-md-4">
    <div class="card glass-card p-4">
        <div class="card-header text-center border-0 bg-transparent">
            <h4 class="mb-0">PDMRead | 登录</h4>
        </div>
        <div class="card-body">
            {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
            {% for category, message in messages %}
            <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
                {{ message }}
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
            {% endfor %}
            {% endif %}
            {% endwith %}

            <form method="POST" action="{{ url_for('app.login') }}">
                <div class="mb-3">
                    <label for="username" class="form-label">用户名</label>
                    <input type="text" class="form-control" id="username" name="username" required>
                </div>
                <div class="mb-3">
                    <label for="password" class="form-label">密码</label>
                    <input type="password" class="form-control" id="password" name="password" required>
                </div>
                <div class="d-grid">
                    <button type="submit" class="btn btn-primary">登录</button>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="/static/bootstrap5/js/bootstrap.bundle.min.js"></script>
</body>
</html>
